<template>
	<web-view :src="url"></web-view>
</template>

<script>
	export default {
		onLoad(options) {
			this.url = decodeURIComponent(options.url);
			console.log(this.url)
			// 检查是否安装百度地图
			uni.getProvider({
				service: 'oauth',
				success: (res) => {
					if (!res.provider.includes('baidumap')) {
						uni.showModal({
							title: '提示',
							content: '未安装百度地图，是否下载？',
							success: (res) => {
								if (res.confirm) {
									// 跳转百度地图下载页
									uni.navigateTo({
										url: '/pages/webview/webview?url=https://map.baidu.com/'
									});
								}
							}
						});
					}
				}
			});
		},
		data() {
			return {
				url: ""
			}
		}
	}
</script>

<style>
</style>